#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
int main()
{
	int a, b, c;
	char date[15];
	int nian, yue, ri;
	scanf("%s", date);
	sscanf(date, "%d-%d-%d", &a, &b, &c);
	
	if (a>=1000) {
		nian = a;
		yue = b;
		ri = c;
	}
	//mm - yyyy - dd
	else if (b>=1000) {
		nian = b;
		yue = a;
		ri = c;
	}
	//mm - dd - yyyy
	else {
		nian = c;
		yue = a;
		ri = b;
	}
	printf("%d-%02d-%02d", nian, yue, ri);

}